import { defineStore } from 'pinia';

export const useUserStore = defineStore('user', {
  state: () => ({
    username: null,
  }),
  actions: {
    login(username) {
      this.username = username;
    },
    logout() {
      this.username = null;
    },
  },
  getters: {
    isLoggedIn: (state) => !!state.username,
  },
});